'use strict';

/**
 * @ngdoc overview
 * @name jgappApp
 * @description
 * # jgappApp
 *
 * Main module of the application.
 */

angular
    .module('jgappApp', [
        'ngAnimate',
        'ngRoute',
        'ngSanitize',
        'ngTouch',
        'LocalStorageModule',
        'infinite-scroll',
        'ngPinchZoom',
        'monospaced.elastic',
        'baiduMap',
        'emojiApp'
    ])
    .config(['$routeProvider', '$httpProvider', 'localStorageServiceProvider', '$locationProvider', function ($routeProvider, $httpProvider, localStorageServiceProvider, $locationProvider) {
        // Intercept POST requests, convert to standard form encoding
        localStorageServiceProvider.setStorageType('sessionStorage');
        // $locationProvider.html5Mode(true);
        $httpProvider.interceptors.push('httpInterceptor');
        $httpProvider.defaults.headers.post["Content-Type"] = "application/x-www-form-urlencoded;charset=utf-8";
        $httpProvider.defaults.transformRequest.unshift(function (data, headersGetter) {
            var key, result = [];

            if (typeof data === "string")
                return data;

            for (key in data) {
                if (data.hasOwnProperty(key))
                    result.push(encodeURIComponent(key) + "=" + encodeURIComponent(data[key]));
            }
            return result.join("&");
        });


        /**
         * The workhorse; converts an object to x-www-form-urlencoded serialization.
         * @param {Object} obj
         * @return {String}
         */
        var param = function (obj) {
            var query = '',
                name, value, fullSubName, subName, subValue, innerObj, i;

            for (name in obj) {
                value = obj[name];
                if (value instanceof Array) {
                    for (i = 0; i < value.length; ++i) {
                        subValue = value[i];
                        fullSubName = name + '[]';
                        innerObj = {};
                        innerObj[fullSubName] = subValue;
                        query += param(innerObj) + '&';
                    }
                } else if (value instanceof Object) {
                    for (subName in value) {
                        subValue = value[subName];
                        fullSubName = name + '[' + subName + ']';
                        innerObj = {};
                        innerObj[fullSubName] = subValue;
                        query += param(innerObj) + '&';
                    }
                } else if (value !== undefined && value !== null)
                    query += encodeURIComponent(name) + '=' + encodeURIComponent(value) + '&';
            }

            return query.length ? query.substr(0, query.length - 1) : query;
        };

        // Override $http service's default transformRequest
        $httpProvider.defaults.transformRequest = [function (data) {
            return angular.isObject(data) && String(data) !== '[object File]' ? param(data) : data;
        }];
        $routeProvider
            .when('/', {
                redirectTo: '/login/login'
            })
            .when('/index/index', {
                templateUrl: 'views/index/index.html',
                controller: 'IndexIndexCtrl',
                controllerAs: 'index/index'
            })
            .when('/index/subindex', {
                templateUrl: 'views/index/subindex.html',
                controller: 'IndexSubindexCtrl',
                controllerAs: 'index/subindex'
            })
            .when('/manage/tbapply/:id', {
                templateUrl: 'views/manage/tbapply.html',
                controller: 'ManageTbapplyCtrl',
                controllerAs: 'tbapply'
            })
            .when('/manage/lend/:id', {
                templateUrl: 'views/manage/lend.html',
                controller: 'ManageLendCtrl',
                controllerAs: 'lend'
            })
            .when('/manage/repay/:id', {
                templateUrl: 'views/manage/repay.html',
                controller: 'ManageRepayCtrl',
                controllerAs: 'repay'
            })
            .when('/manage/lendid/:id', {
                templateUrl: 'views/manage/lendid.html',
                controller: 'ManageLendidCtrl',
                controllerAs: 'lendid'
            })
            .when('/manage/repayid/:id', {
                templateUrl: 'views/manage/repayid.html',
                controller: 'ManageRepayidCtrl',
                controllerAs: 'repayid'
            })
            .when('/work/index', {
                templateUrl: 'views/work/index.html',
                controller: 'WorkIndexCtrl',
                controllerAs: 'work/index'
            })
            .when('/work/noticelist', {
                templateUrl: 'views/work/noticelist.html',
                controller: 'WorkNoticelistCtrl',
                controllerAs: 'work/noticelist'
            })
            .when('/work/noticedetail', {
                templateUrl: 'views/work/noticedetail.html',
                controller: 'WorkNoticedetailCtrl',
                controllerAs: 'work/noticedetail'
            })
            .when('/user/index', {
                templateUrl: 'views/user/index.html',
                controller: 'UserIndexCtrl',
                controllerAs: 'index'
            })
            .when('/contract/fgscontract/:id', {
                templateUrl: 'views/contract/fgscontract.html',
                controller: 'ContractFgscontractCtrl',
                controllerAs: 'contract/fgscontract'
            })
            .when('/contract/gccontract/:id', {
                templateUrl: 'views/contract/gccontract.html',
                controller: 'ContractGccontractCtrl',
                controllerAs: 'contract/gccontract'
            })
            .when('/contract/zjcontract/:id', {
                templateUrl: 'views/contract/zjcontract.html',
                controller: 'ContractZjcontractCtrl',
                controllerAs: 'contract/zjcontract'
            })
            .when('/finance/zjfy/:id', {
                templateUrl: 'views/finance/zjfy.html',
                controller: 'FinanceZjfyCtrl',
                controllerAs: 'finance/zjfy'
            })
            .when('/finance/f_zjfy/:id', {
                templateUrl: 'views/finance/f_zjfy.html',
                controller: 'FinanceFZjfyCtrl',
                controllerAs: 'finance/fZjfy'
            })
            .when('/finance/f_bxd/:id', {
                templateUrl: 'views/finance/f_bxd.html',
                controller: 'FinanceFBxdCtrl',
                controllerAs: 'finance/fBxd'
            })
            .when('/finance/f_fkd/:id', {
                templateUrl: 'views/finance/f_fkd.html',
                controller: 'FinanceFFkdCtrl',
                controllerAs: 'finance/fFkd'
            })
            .when('/finance/f_jkd/:id', {
                templateUrl: 'views/finance/f_jkd.html',
                controller: 'FinanceFJkdCtrl',
                controllerAs: 'finance/fJkd'
            })
            .when('/finance/f_gck/:id', {
                templateUrl: 'views/finance/f_gck.html',
                controller: 'FinanceFGckCtrl',
                controllerAs: 'finance/fGck'
            })
            .when('/finance/f_bzj/:id', {
                templateUrl: 'views/finance/f_bzj.html',
                controller: 'FinanceFBzjCtrl',
                controllerAs: 'finance/fBzj'
            })
            .when('/finance/f_sk/:id', {
                templateUrl: 'views/finance/f_sk.html',
                controller: 'FinanceFSkCtrl',
                controllerAs: 'finance/fSk'
            })
            .when('/finance/choosepeople', {
                templateUrl: 'views/finance/choosepeople.html',
                controller: 'FinanceChoosepeopleCtrl',
                controllerAs: 'finance/choosepeople'
            })
            .when('/login/login', {
                templateUrl: 'views/login/login.html',
                controller: 'LoginLoginCtrl',
                controllerAs: 'Login'
            })
            .when('/personnel/bdtip/:id', {
                templateUrl: 'views/personnel/bdtip.html',
                controller: 'PersonnelBdtipCtrl',
                controllerAs: 'bdtip'
            })
            .when('/personnel/cctip/:id', {
                templateUrl: 'views/personnel/cctip.html',
                controller: 'PersonnelCctipCtrl',
                controllerAs: 'cctip'
            })
            .when('/personnel/jbtip/:id', {
                templateUrl: 'views/personnel/jbtip.html',
                controller: 'PersonnelJbtipCtrl',
                controllerAs: 'jbtip'
            })
            .when('/personnel/qjtip/:id', {
                templateUrl: 'views/personnel/qjtip.html',
                controller: 'PersonnelQjtipCtrl',
                controllerAs: 'qjtip'
            })
            .when('/personnel/txtip/:id', {
                templateUrl: 'views/personnel/txtip.html',
                controller: 'PersonnelTxtipCtrl',
                controllerAs: 'txtip'
            })
            .when('/personnel/gztip/:id', {
                templateUrl: 'views/personnel/gztip.html',
                controller: 'PersonnelGztipCtrl',
                controllerAs: 'gztip'
            })
            .when('/personnel/tcsqtip/:id', {
                templateUrl: 'views/personnel/tcsqtip.html',
                controller: 'PersonnelTcsqtipCtrl',
                controllerAs: 'tcsqtip'
            })
            .when('/administrator/admin_bz/:id', {
                templateUrl: 'views/administrator/admin_bz.html',
                controller: 'AdministratorAdminBzCtrl',
                controllerAs: 'adminBz'
            })
            .when('/administrator/admin_hyz/:id', {
                templateUrl: 'views/administrator/admin_hyz.html',
                controller: 'AdministratorAdminHyzCtrl',
                controllerAs: 'adminHyz'
            })
            .when('/administrator/admin_jyz/:id', {
                templateUrl: 'views/administrator/admin_jyz.html',
                controller: 'AdministratorAdminJyzCtrl',
                controllerAs: 'adminJyz'
            })
            .when('/administrator/admin_kyz/:id', {
                templateUrl: 'views/administrator/admin_kyz.html',
                controller: 'AdministratorAdminKyzCtrl',
                controllerAs: 'adminKyz'
            })
            .when('/administrator/admin_tzfw/:id', {
                templateUrl: 'views/administrator/admin_tzfw.html',
                controller: 'AdministratorAdminTzfwCtrl',
                controllerAs: 'adminTzfw'
            })
            .when('/administrator/admin_yzzx/:id', {
                templateUrl: 'views/administrator/admin_yzzx.html',
                controller: 'AdministratorAdminYzzxCtrl',
                controllerAs: 'adminYzzx'
            })
            .when('/administrator/admin_zjzczx/:id', {
                templateUrl: 'views/administrator/admin_zjzczx.html',
                controller: 'AdministratorAdminZjzczxCtrl',
                controllerAs: 'adminZjzczx'
            })
            .when('/user/setting', {
                templateUrl: 'views/user/setting.html',
                controller: 'UserSettingCtrl',
                controllerAs: 'setting'
            })
            .when('/user/feedback', {
                templateUrl: 'views/user/feedback.html',
                controller: 'UserFeedbackCtrl',
                controllerAs: 'feedback'
            })
            .when('/user/changepswd', {
                templateUrl: 'views/user/changepswd.html',
                controller: 'UserChangepswdCtrl',
                controllerAs: 'changepswd'
            })
            .when('/user/msglist', {
                templateUrl: 'views/user/msglist.html',
                controller: 'UserMsglistCtrl',
                controllerAs: 'msglist'
            })
            .when('/manage/chooseinfo/:id', {
                templateUrl: 'views/manage/chooseinfo.html',
                controller: 'ManageChooseinfoCtrl',
                controllerAs: 'chooseinfo'
            })
            .when('/administrator/chooseinfo/:id', {
                templateUrl: 'views/administrator/chooseinfo.html',
                controller: 'AdministratorChooseinfoCtrl',
                controllerAs: 'chooseinfo'
            })
            .when('/aboutme/index', {
                templateUrl: 'views/aboutme/index.html',
                controller: 'AboutmeIndexCtrl',
                controllerAs: 'index'
            })
            .when('/manage/checktbapply/:id', {
                templateUrl: 'views/manage/checktbapply.html',
                controller: 'TaskreviewCtrl',
                controllerAs: 'checktbapply'
            })
            .when('/contract/checkgccontract/:id', {
                templateUrl: 'views/contract/checkgccontract.html',
                controller: 'TaskreviewCtrl',
                controllerAs: 'contract/checkgccontract'
            })
            .when('/contract/checkzjcontract/:id', {
                templateUrl: 'views/contract/checkzjcontract.html',
                controller: 'TaskreviewCtrl',
                controllerAs: 'contract/checkzjcontract'
            })
            .when('/contract/checkfgscontract/:id', {
                templateUrl: 'views/contract/checkfgscontract.html',
                controller: 'TaskreviewCtrl',
                controllerAs: 'contract/checkfgscontract'
            })
            .when('/personnel/checkjbtip/:id', {
                templateUrl: 'views/personnel/checkjbtip.html',
                controller: 'TaskreviewCtrl',
                controllerAs: 'checkjbtip'
            })
            .when('/personnel/checkbdtip/:id', {
                templateUrl: 'views/personnel/checkbdtip.html',
                controller: 'TaskreviewCtrl',
                controllerAs: 'checkbdtip'
            })
            .when('/personnel/checktxtip/:id', {
                templateUrl: 'views/personnel/checktxtip.html',
                controller: 'TaskreviewCtrl',
                controllerAs: 'checktxtip'
            })
            .when('/personnel/checkcctip/:id', {
                templateUrl: 'views/personnel/checkcctip.html',
                controller: 'TaskreviewCtrl',
                controllerAs: 'checkcctip'
            })
            .when('/personnel/checkqjtip/:id', {
                templateUrl: 'views/personnel/checkqjtip.html',
                controller: 'TaskreviewCtrl',
                controllerAs: 'checkqjtip'
            })
            .when('/personnel/checkandj/:id', {
                templateUrl: 'views/personnel/checkandj.html',
                controller: 'TaskreviewCtrl',
                controllerAs: 'checkandj'
            })
            .when('/personnel/checkycsq/:id', {
                templateUrl: 'views/personnel/checkycsq.html',
                controller: 'TaskreviewCtrl',
                controllerAs: 'checkycsq'
            })
            .when('/personnel/checkwcbs/:id', {
                templateUrl: 'views/personnel/checkwcbs.html',
                controller: 'TaskreviewCtrl',
                controllerAs: 'checkwcbs'
            })
            .when('/finance/checkf_zjfy/:id', {
                templateUrl: 'views/finance/checkf_zjfy.html',
                controller: 'TaskreviewCtrl',
                controllerAs: 'finance/checkfZjfy'
            })
            .when('/personnel/checkgztip/:id', {
                templateUrl: 'views/personnel/checkgztip.html',
                controller: 'TaskreviewCtrl',
                controllerAs: 'checkgztip'
            })
            .when('/finance/checkf_fgssk/:id', {
                templateUrl: 'views/finance/checkf_fgssk.html',
                controller: 'TaskreviewCtrl',
                controllerAs: 'finance/checkfFgssk'
            })
            .when('/finance/checkf_fkd/:id', {
                templateUrl: 'views/finance/checkf_fkd.html',
                controller: 'TaskreviewCtrl',
                controllerAs: 'finance/checkfFkd'
            })
            .when('/finance/checkf_yhkh/:id', {
                templateUrl: 'views/finance/checkf_yhkh.html',
                controller: 'TaskreviewCtrl',
                controllerAs: 'finance/checkfYhkh'
            })
            .when('/finance/checkf_bzj/:id', {
                templateUrl: 'views/finance/checkf_bzj.html',
                controller: 'TaskreviewCtrl',
                controllerAs: 'finance/checkfBzj'
            })
            .when('/finance/checkf_glfsk/:id', {
                templateUrl: 'views/finance/checkf_glfsk.html',
                controller: 'TaskreviewCtrl',
                controllerAs: 'finance/checkfGlfsk'
            })
            .when('/finance/checkf_sk/:id', {
                templateUrl: 'views/finance/checkf_sk.html',
                controller: 'TaskreviewCtrl',
                controllerAs: 'finance/checkfSk'
            })
            .when('/finance/checkf_jkd/:id', {
                templateUrl: 'views/finance/checkf_jkd.html',
                controller: 'TaskreviewCtrl',
                controllerAs: 'finance/checkfJkd'
            })
            .when('/finance/checkf_bxd/:id', {
                templateUrl: 'views/finance/checkf_bxd.html',
                controller: 'TaskreviewCtrl',
                controllerAs: 'finance/checkfBxd'
            })
            .when('/finance/checkf_yhbh/:id', {
                templateUrl: 'views/finance/checkf_yhbh.html',
                controller: 'TaskreviewCtrl',
                controllerAs: 'finance/checkfYhbh'
            })
            .when('/finance/checkf_gck/:id', {
                templateUrl: 'views/finance/checkf_gck.html',
                controller: 'TaskreviewCtrl',
                controllerAs: 'finance/checkfGck'
            })
            .when('/finance/checkf_wjz/:id', {
                templateUrl: 'views/finance/checkf_wjz.html',
                controller: 'TaskreviewCtrl',
                controllerAs: 'finance/checkfWjz'
            })
            .when('/finance/checkf_tbfsk/:id', {
                templateUrl: 'views/finance/checkf_tbfsk.html',
                controller: 'TaskreviewCtrl',
                controllerAs: 'finance/checkfTbfsk'
            })
            .when('/finance/checkf_gcsp/:id', {
                templateUrl: 'views/finance/checkf_gcsp.html',
                controller: 'TaskreviewCtrl',
                controllerAs: 'finance/checkfGcsp'
            })
            .when('/personnel/checkyjtc/:id', {
                templateUrl: 'views/personnel/checkyjtc.html',
                controller: 'TaskreviewCtrl',
                controllerAs: 'checkyjtc'
            })
            .when('/manage/check_lend/:id', {
                templateUrl: 'views/manage/check_lend.html',
                controller: 'TaskreviewCtrl',
                controllerAs: 'checkLend'
            })
            .when('/manage/check_lendid/:id', {
                templateUrl: 'views/manage/check_lendid.html',
                controller: 'TaskreviewCtrl',
                controllerAs: 'checkLendid'
            })
            .when('/manage/check_reapy/:id', {
                templateUrl: 'views/manage/check_reapy.html',
                controller: 'TaskreviewCtrl',
                controllerAs: 'checkReapy'
            })
            .when('/manage/check_reapyid/:id', {
                templateUrl: 'views/manage/check_reapyid.html',
                controller: 'TaskreviewCtrl',
                controllerAs: 'checkReapyid'
            })
            .when('/administrator/check_admin_bz/:id', {
                templateUrl: 'views/administrator/check_admin_bz.html',
                controller: 'TaskreviewCtrl',
                controllerAs: 'checkAdminBz'
            })
            .when('/administrator/check_admin_hyz/:id', {
                templateUrl: 'views/administrator/check_admin_hyz.html',
                controller: 'TaskreviewCtrl',
                controllerAs: 'checkAdminHyz'
            })
            .when('/administrator/check_admin_jyz/:id', {
                templateUrl: 'views/administrator/check_admin_jyz.html',
                controller: 'TaskreviewCtrl',
                controllerAs: 'checkAdminJyz'
            })
            .when('/administrator/check_admin_kyz/:id', {
                templateUrl: 'views/administrator/check_admin_kyz.html',
                controller: 'TaskreviewCtrl',
                controllerAs: 'checkAdminKyz'
            })
            .when('/administrator/check_admin_tzfw/:id', {
                templateUrl: 'views/administrator/check_admin_tzfw.html',
                controller: 'TaskreviewCtrl',
                controllerAs: 'checkAdminTzfw'
            })
            .when('/administrator/check_admin_yzzx/:id', {
                templateUrl: 'views/administrator/check_admin_yzzx.html',
                controller: 'TaskreviewCtrl',
                controllerAs: 'checkAdminYzzx'
            })
            .when('/administrator/check_admin_zjzczx/:id', {
                templateUrl: 'views/administrator/check_admin_zjzczx.html',
                controller: 'TaskreviewCtrl',
                controllerAs: 'checkAdminZjzczx'
            })
            .when('/administrator/check_admin_yydj/:id', {
                templateUrl: 'views/administrator/check_admin_yydj.html',
                controller: 'TaskreviewCtrl',
                controllerAs: 'checkAdminYydj'
            })
            .when('/task/taskreport/:reporttype', {
                templateUrl: 'views/task/taskreport.html',
                controller: 'TaskTaskreportCtrl',
                controllerAs: 'taskreport'
            })
            .when('/task/newtask', {
                templateUrl: 'views/task/newtask.html',
                controller: 'TaskNewtaskCtrl',
                controllerAs: 'newtask'
            })
            .when('/task/mytask', {
                templateUrl: 'views/task/mytask.html',
                controller: 'TaskMytaskCtrl',
                controllerAs: 'mytask'
            })
            .when('/task/taskdetail/:pkId', {
                templateUrl: 'views/task/taskdetail.html',
                controller: 'TaskTaskdetailCtrl',
                controllerAs: 'newtask'
            })
            .when('/task/choosepeople/:from/:depId', {
                templateUrl: 'views/task/choosepeople.html',
                controller: 'TaskChoosepeopleCtrl',
                controllerAs: 'choosepeople'
            })
            .when('/task/dailylist/:type/:data', {
                templateUrl: 'views/task/dailylist.html',
                controller: 'TaskDailylistCtrl',
                controllerAs: 'dailylist'
            })
            .when('/task/weeklylist/:type/:data', {
                templateUrl: 'views/task/weeklylist.html',
                controller: 'TaskWeeklylistCtrl',
                controllerAs: 'weeklylist'
            })
            .when('/task/weeklydetail/:pkId', {
                templateUrl: 'views/task/weeklydetail.html',
                controller: 'TaskWeeklydetailCtrl',
                controllerAs: 'weeklydetail'
            })
            .when('/task/dailydetail/:pkId', {
                templateUrl: 'views/task/dailydetail.html',
                controller: 'TaskDailydetailCtrl',
                controllerAs: 'dailydetail'
            })
            .when('/task/mytasklist/:pagetype', {
                templateUrl: 'views/task/mytasklist.html',
                controller: 'TaskMytasklistCtrl',
                controllerAs: 'mytasklist'
            })
            .when('/task/subtask/:type', {
                templateUrl: 'views/task/subtask.html',
                controller: 'TaskSubtaskCtrl',
                controllerAs: 'subtask'
            })
            .when('/task/choosedeps/:from', {
                templateUrl: 'views/task/choosedeps.html',
                controller: 'TaskChoosedepsCtrl',
                controllerAs: 'choosedeps'
            })
            .when('/task/chooseweekly', {
                templateUrl: 'views/task/chooseweekly.html',
                controller: 'TaskChooseweeklyCtrl',
                controllerAs: 'chooseweekly'
            })
            .when('/task/choosedaily', {
                templateUrl: 'views/task/choosedaily.html',
                controller: 'TaskChoosedailyCtrl',
                controllerAs: 'choosedaily'
            })
            .when('/task/weeklyfromyear', {
                templateUrl: 'views/task/weeklyfromyear.html',
                controller: 'TaskWeeklyfromyearCtrl',
                controllerAs: 'weeklyfromyear'
            })
            .when('/task/newdaily', {
                templateUrl: 'views/task/newdaily.html',
                controller: 'TaskNewdailyCtrl',
                controllerAs: 'newdaily'
            })
            .when('/task/newweekly', {
                templateUrl: 'views/task/newweekly.html',
                controller: 'TaskNewweeklyCtrl',
                controllerAs: 'newweekly'
            })
            .when('/task/addjoinpeople/:type', {
                templateUrl: 'views/task/addjoinpeople.html',
                controller: 'TaskAddjoinpeopleCtrl',
                controllerAs: 'addjoinpeople'
            })
            .when('/relativePage/:module/:name/:formKey/:moduleNo', { //模块名/视图名
                templateUrl: function ($routeParams) {
                    return ("views/" + $routeParams.module + "/" + $routeParams.name + ".html")
                },
                controller: 'RelativepageCtrl',
                controllerAs: 'relativePage',
            })
            .when('/personnel/ycsq/:id', {
                templateUrl: 'views/personnel/ycsq.html',
                controller: 'PersonnelYcsqCtrl',
                controllerAs: 'personnel/ycsq'
            })
            .when('/personnel/wcbs/:id', {
                templateUrl: 'views/personnel/wcbs.html',
                controller: 'PersonnelWcbsCtrl',
                controllerAs: 'personnel/wcbs'
            })
            .when('/administrator/admin_yydj/:id', {
                templateUrl: 'views/administrator/admin_yydj.html',
                controller: 'AdministratorAdminYydjCtrl',
                controllerAs: 'administrator/adminYydj'
            })
            .when('/finance/f_yhbh/:id', {
                templateUrl: 'views/finance/f_yhbh.html',
                controller: 'FinanceFYhbhCtrl',
                controllerAs: 'finance/fYhbh'
            })
            .when('/finance/f_yhkh/:id', {
                templateUrl: 'views/finance/f_yhkh.html',
                controller: 'FinanceFYhkhCtrl',
                controllerAs: 'finance/fYhkh'
            })
            .when('/finance/f_gcsp/:id', {
                templateUrl: 'views/finance/f_gcsp.html',
                controller: 'FinanceFGcspCtrl',
                controllerAs: 'finance/fGcsp'
            })
            .when('/finance/f_wjz/:id', {
                templateUrl: 'views/finance/f_wjz.html',
                controller: 'FinanceFWjzCtrl',
                controllerAs: 'finance/fWjz'
            })
            .when('/administrator/check_admin_zjdp/:id', {
                templateUrl: 'views/administrator/check_admin_zjdp.html',
                controller: 'TaskreviewCtrl',
                controllerAs: 'administrator/checkAdminZjdp'
            })
            .when('/addressBook/index', {
                templateUrl: 'views/addressbook/index.html',
                controller: 'AddressbookIndexCtrl',
                controllerAs: 'addressBook'
            })
            .when('/user/aboutJG', {
                templateUrl: 'views/user/aboutjg.html',
                controller: 'UserAboutjgCtrl',
                controllerAs: 'aboutJG'
            })
            .when('/user/updatelog', {
                templateUrl: 'views/user/updatelog.html',
                controller: 'UserUpdatelogCtrl',
                controllerAs: 'updatelog'
            })
            .when('/userdefined/userdefined/:id', {
                templateUrl: 'views/userdefined/userdefined.html',
                controller: 'UserdefinedUserdefinedCtrl',
                controllerAs: 'userdefined/userdefined'
            })
            .when('/userdefined/check_userdefined/:id', {
                templateUrl: 'views/userdefined/check_userdefined.html',
                controller: 'TaskreviewCtrl',
                controllerAs: 'userdefined/userdefined'
            })
            .when('/userdefined/choosePerson', {
                templateUrl: 'views/userdefined/chooseperson.html',
                controller: 'UserdefinedChoosepersonCtrl',
                controllerAs: 'choosePerson'
            })
            .when('/openfile/openfile/:type/:id', {
                templateUrl: 'views/openfile/openfile.html',
                controller: 'OpenfileOpenfileCtrl',
                controllerAs: 'openfile/openfile'
            })
            .when('/manage/bidnotice/:id', {
                templateUrl: 'views/manage/bidnotice.html',
                controller: 'ManageBidnoticeCtrl',
                controllerAs: 'manage/bidnotice'
            })
            .when('/manage/bidcharge/:id', {
                templateUrl: 'views/manage/bidcharge.html',
                controller: 'ManageBidchargeCtrl',
                controllerAs: 'manage/bidcharge'
            })
            .when('/finance/SendDepositApply/:id', {
                templateUrl: 'views/finance/senddepositapply.html',
                controller: 'FinanceSenddepositapplyCtrl',
                controllerAs: 'finance/SendDepositApply'
            })
            .when('/finance/BackDepositApply/:id', {
                templateUrl: 'views/finance/backdepositapply.html',
                controller: 'FinanceBackdepositapplyCtrl',
                controllerAs: 'finance/BackDepositApply'
            })
            .when('/finance/check_SendDepositApply/:id', {
                templateUrl: 'views/finance/check_senddepositapply.html',
                controller: 'TaskreviewCtrl',
                controllerAs: 'finance/SendDepositApply'
            })
            .when('/finance/check_BackDepositApply/:id', {
                templateUrl: 'views/finance/check_backdepositapply.html',
                controller: 'TaskreviewCtrl',
                controllerAs: 'finance/BackDepositApply'
            })
            .when('/manage/chooseperformance', {
                templateUrl: 'views/manage/chooseperformance.html',
                controller: 'ManageChooseperformanceCtrl',
                controllerAs: 'manage/chooseperformance'
            })
            .when('/work/tbnoticelist', {
                templateUrl: 'views/work/tbnoticelist.html',
                controller: 'WorkTbnoticelistCtrl',
                controllerAs: 'tbnoticelist'
            })
            .when('/work/tbnoticeDetail', {
                templateUrl: 'views/manage/checktbapply.html',
                controller: 'WorkTbnoticedetailCtrl',
                controllerAs: 'work/tbnoticeDetail'
            })
            .when('/work/systemnotice/:pkId', {
                templateUrl: 'views/work/systemnotice.html',
                controller: 'WorkSystemnoticeCtrl',
                controllerAs: 'Systemnotice'
            })
            .when('/addressbook/userdetail/:userId', {
                templateUrl: 'views/addressbook/userdetail.html',
                controller: 'AddressbookUserdetailCtrl',
                controllerAs: 'userdetail'
            })
            .when('/chat/index', {
                templateUrl: 'views/chat/index.html',
                controller: 'ChatIndexCtrl',
                controllerAs: 'chatIndex'
            })
            .when('/chat/chatroom/:targetId/:conversationType', {
                templateUrl: 'views/chat/chatroom.html',
                controller: 'ChatChatroomCtrl',
                controllerAs: 'chatroom'
            })
            .when('/work/custSvc', {
                templateUrl: 'views/work/custsvc.html',
                controller: 'WorkCustsvcCtrl',
                controllerAs: 'work/custSvc'
            })
            .when('/chat/setting', {
                templateUrl: 'views/chat/setting.html',
                controller: 'ChatSettingCtrl',
                controllerAs: 'chatsetting'
            })
            .when('/chat/selectuser', {
                templateUrl: 'views/chat/selectuser.html',
                controller: 'ChatSelectuserCtrl',
                controllerAs: 'contactuser'
            })
            .when('/chat/groupDetail/:id', {
                templateUrl: 'views/chat/groupdetail.html',
                controller: 'ChatGroupdetailCtrl',
                controllerAs: 'groupDetail'
            })
            .when('/chat/groupusers/:id/:userId', {
                templateUrl: 'views/chat/groupusers.html',
                controller: 'ChatGroupusersCtrl',
                controllerAs: 'groupusers'
            })
            .when('/attendance/index', {
                templateUrl: 'views/attendance/index.html',
                controller: 'AttendanceIndexCtrl',
                controllerAs: 'attendance'
            })
            .when('/attendance/attendance_list', {
                templateUrl: 'views/attendance/attendance_list.html',
                controller: 'AttendanceAttendanceListCtrl',
                controllerAs: 'attendanceList'
            })
            .when('/attendance/edit_location', {
                templateUrl: 'views/attendance/edit_location.html',
                controller: 'AttendanceEdit_location',
                controllerAs: 'addAttendance'
            })
            .when('/attendance/attendance_detail/:pkId?', {
                templateUrl: 'views/attendance/attendance_detail.html',
                controller: 'AttendanceAttendanceDetailCtrl',
                controllerAs: 'attendanceDetail'
            })
            .when('/attendance/attendance_statistic', {
                templateUrl: 'views/attendance/attendance_statistic.html',
                controller: 'AttendanceAttendanceStatisticCtrl',
                controllerAs: 'attendanceStatistic'
            })
            .when('/attendance/attendance_statisticDetail', {
                templateUrl: 'views/attendance/attendance_statisticdetail.html',
                controller: 'AttendanceAttendanceStatisticdetailCtrl',
                controllerAs: 'attendanceStatisticDetail'
            })
            .when('/attendance/attendance_log/:type', {
                templateUrl: 'views/attendance/attendance_log.html',
                controller: 'AttendanceAttendanceLogCtrl',
                controllerAs: 'attendanceLog'
            })
            .when('/attendance/attendance_late/:type', {
                templateUrl: 'views/attendance/attendance_late.html',
                controller: 'AttendanceAttendanceLateCtrl',
                controllerAs: 'attendanceLate'
            })
            .when('/attendance/attendance_outside', {
                templateUrl: 'views/attendance/attendance_outside.html',
                controller: 'AttendanceAttendanceOutsideCtrl',
                controllerAs: 'attendanceOutside'
            })
            .when('/attendance/show_location/:lat/:lng/:distance?', {
                templateUrl: 'views/attendance/show_location.html',
                controller: 'AttendanceShowLocationCtrl',
                controllerAs: 'showLocation'
            })
            .when('/attendance/attendance_user/:id?', {
                templateUrl: 'views/attendance/attendance_user.html',
                controller: 'AttendanceAttendanceUserCtrl',
                controllerAs: 'attendanceUser'
            })
            .when('/attendance/attendance_deps/:id?', {
                templateUrl: 'views/attendance/attendance_deps.html',
                controller: 'AttendanceAttendanceDepsCtrl',
                controllerAs: 'attendanceDeps'
            })
            .when('/finance/addvaluetax/:id', {
                templateUrl: 'views/finance/addvaluetax.html',
                controller: 'FinanceAddvaluetaxCtrl',
                controllerAs: 'finance/addvaluetax'
            })
            .when('/finance/check_addvaluetax/:id', {
                templateUrl: 'views/finance/check_addvaluetax.html',
                controller: 'TaskreviewCtrl',
                controllerAs: 'finance/checkAddvaluetax'
            })
            .when('/administrator/admin_zjdp/:id', {
                templateUrl: 'views/administrator/admin_zjdp.html',
                controller: 'AdministratorAdminZjdpCtrl',
                controllerAs: 'administrator/adminZjdp'
            })
            .when('/personnel/ccsq/:id', {
                templateUrl: 'views/personnel/ccsq.html',
                controller: 'PersonnelCcsqCtrl',
                controllerAs: 'personnel/ccsq'
            })
            .when('/personnel/checkccsq/:id', {
                templateUrl: 'views/personnel/checkccsq.html',
                controller: 'TaskreviewCtrl',
                controllerAs: 'personnel/checkccsq'
            })
            .when('/sign/index', {
                templateUrl: 'views/sign/index.html',
                controller: 'SignIndexCtrl',
                controllerAs: 'signIndex'
            })
            .when('/sign/footmark', {
                templateUrl: 'views/sign/footmark.html',
                controller: 'SignFootmarkCtrl',
                controllerAs: 'footmark'
            })
            .when('/sign/footmarkdetail', {
                templateUrl: 'views/attendance/show_location.html',
                controller: 'SignFootmarkdetailCtrl',
                controllerAs: 'showLocation'
            })
            .when('/sign/chooselocation', {
                templateUrl: 'views/sign/location.html',
                controller: 'SignChooselocationCtrl',
                controllerAs: 'chooselocation'
            })
            .otherwise({
                redirectTo: '/'
            });

    }]).run(function (Util) {
        Util.init();
    });

// function bootstrapAngular() {
//     var domElement = document.querySelector("body")
//     angular.bootstrap(domElement, ["jgappApp"]);
// }

// // This is my preferred Cordova detection method, as it doesn't require updating.
// if (document.URL.indexOf('http://') === -1 && document.URL.indexOf('https://') === -1) {
//     console.log("URL: Running in Cordova/PhoneGap");
//     document.addEventListener("deviceready", bootstrapAngular, false);
// } else {
//     console.log("URL: Running in browser");
//     bootstrapAngular();
// }